import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'

async function bootstrap() {
  const app = await NestFactory.create(AppModule);

  const options = new DocumentBuilder()
      .setTitle('demo')
      .setDescription('demo api')
      .setVersion('1.0')
      .build()
  const document = SwaggerModule.createDocument(app,options)
  SwaggerModule.setup('api-docs',app,document)

  await app.listen(8888, () => {
    console.log('http://localhost:8888/');
    console.log('文档：http://localhost:8888/api-docs');
  });
}
bootstrap();
